package com.lzs.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lzs.entity.Menu;
import com.lzs.entity.Role;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lzs.util.R;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色表 服务类
 * </p>
 *
 * @author 刘中帅
 * @since 2020-11-24
 */
@Service
public interface RoleService extends IService<Role> {
    List<Role> selectRoleTree();
    // 角色分页查询
    Page<Role> selectAllRolePage(Integer page, Integer limit, Role role);
    R insertOrUpdateRole(Role role);
    List<Long> selectMenuByRoleId(Long roleId);
    R updateMenuByRoleId(Long roleId,List<Long> menus);
    IPage<Role> selectRolePage(Integer page,Integer limit,Role role);
//    List<Role> selectMenuByUserId();
   R findByRoleId(Long roleId);
   boolean isYeZi(Long pid, List<Menu> menus);
}
